import http from "@/utils/http";
import {GW} from "@/common/const";
/**
 * 南北向资金首页
 * @return {Promise} Array
 */
export function getIndexData(option) {
  const url =`${GW}/gw/ynstockinfo/client/snfund/index`;
  const params = {
    ...option,
  };
  return http.get(url,params);
}

/**
 * 南北向资金成分股列表
 * @param {String} type - 参数注释  类型:hk2sh-沪股通,hk2sz-深股通,sh2hk-港股通(沪),sz2hk-港股通(深)
 * @param {String} field - 	排序字段,不传值时默认使用 px_change_rate(涨跌幅降序)
 * @param {String} sort - 排序 asc-升序,desc-降序,缺省时默认降序
 * @return {Promise} Object
 */

export function getList(option) {
  const url = `${GW}/gw/ynstockinfo/client/snfund/stock`;
  const params = {
    pageNo: 1,
    pageSize: 10,
    type: "",
    field: "",
    sort: "",
    ...option,
  };
  return http.get(url, params); 
}
